//拼团首页
exports.refund_order_list = function (req, res) {

    //获取restful参数
    var restfulParams = req.routeInfo.restfulParams;

    //最终结果
    var resultData = {};

    var skip = restfulParams.skip == undefined ? 0 : restfulParams.skip;

    var limit = restfulParams.limit == undefined ? config.publicConfig.LIMIT : restfulParams.limit;
    //任务流创建
    async.waterfall([
            //1.拼团活动
            function (cb) {

                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.refund_order_list + "/sort_order/of_apply_time-desc/sort_order/of_check_status-asc/o_is_refund/1/o_oid/" + restfulParams.o_oid + "/skip/" + skip + "/limit/" + limit+"/sort_order/of_check_status-asc",
                        method: 'POST',
                        data: {
                            fields: [
                                        "o_id",
                                        "o_no",
                                       "o_uid",
                                       "of_check_status",
                                       "o_course_name",
                                       "o_course_pic",
                                       "o_type",
                                       "o_activity_type",
                                       "o_pay_money",
                                       "of_refund_reason",
                                       "o_name",
                                       "o_phone",
                                        "o_old_price",
                                        "o_wechat_pay",
                                        "o_we_chat_no",
                                         "u_header_url",
                                         "of_dec",
                            ].join(",")
                        }
                    },
                    function (err, data) {
                        //判断是否有错误信息
                        if (err) {
                            return cb(err, data);
                        }

                        resultData.refundOrderList = data.data;
                        cb();
                    }
                );

            },

        ], function (err, result) {

            //返回最终拼接结果
            RES.response(res, true, resultData);

        }
    );

}